<span id="spanplaceorder_{$att_id}"></span>
<div class="post_win_2" style="left:120px;display:none">
	<div class="post_win_t"></div>
	<a href="#" class="close">关闭</a>
	<input type="hidden" id="file_info" />
	<div style="text-align: center; padding: 30px 0 15px 0;">
		<img src="" width="160" height="90" />
	</div>
</div>

<script type="text/javascript" charset="utf-8">
$('.post_win_2 a.close').click(function(){
  $('#file_info').val('');
  $('.post_win_2').hide();
  return false;
});

var att_url = '{Config::get('att_url')}';
new SWFUpload({
	// Backend Settings
	upload_url: SITE_URL+"/ajax/upload_pic.html",

	// File Upload Settings
	//file_size_limit : "100M",	// 100MB
	file_types : "*.jpg;*.png;*.gif",
	file_types_description : "Image Files",
	file_upload_limit : "0",
	file_queue_limit : "1",

	file_dialog_start_handler : function (){
	  
	},
	file_queued_handler : function (file) {

  },
	file_queue_error_handler : function (file, errorCode, message) {
	  alert('file_queue_error_handler'+errorCode);
	},
	file_dialog_complete_handler : function (numFilesSelected, numFilesQueued) {
    if (numFilesSelected > 0 && numFilesQueued > 0) {
        this.setButtonDisabled(true);
        this.startUpload();
    }
  },
	upload_start_handler : function (file){
	  
	},
	upload_progress_handler : function uploadProgress(file, bytesLoaded, bytesTotal) {
	  var percent = Math.ceil((bytesLoaded / bytesTotal) * 100);
	},
	upload_error_handler : function(file, errorCode, message){
	  alert('upload_error_handler'+errorCode);
	},
	upload_success_handler : function (file, serverData){
	  var html = '';
	  $('#file_info').val(serverData);
	  $('.post_win_2 img').attr('src', att_url+serverData);
    $('.post_win_2').show();
	},
	upload_complete_handler : function (file) {
	  if (this.getStats().files_queued > 0) {
	    this.startUpload();
	  } else {
      this.setButtonDisabled(false);
	  }
	},

	// Button Settings
	button_image_url : SITE_URL+"/Library/3rd/swfupload/XPButtonUploadText_61x22.png",
	button_placeholder_id : "spanplaceorder_{$att_id}",
	button_width: 60,
	button_height: 15,

	// Flash Settings
	flash_url : SITE_URL+"/Library/3rd/swfupload/swfupload.swf",
	

	custom_settings : {
		att_id : "{$att_id}"
	},
	
	// Debug Settings
	debug: false
});
</script>